package de.tuberlin.julia.SFD_Numbers;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import com.google.code.microlog4android.Logger;
import com.google.code.microlog4android.LoggerFactory;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class EndBlockView extends Activity{
	
	private static final Logger logger = LoggerFactory.getLogger();
	
	Button weiter;
	TextView info;
	
    TimeZone tz = TimeZone.getTimeZone("Europe/Berlin");
    Locale locale = Locale.GERMANY;
    final Calendar c = Calendar.getInstance(tz,locale);   	            
    SimpleDateFormat f= new SimpleDateFormat("HH:mm:ss.SS");
    
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
		setContentView(R.layout.endblockview);	
		
        info = (TextView) findViewById(R.id.TextView02);
        
        int block = this.getIntent().getIntExtra("block",0);
        int run = this.getIntent().getIntExtra("run",0);
        
        f.setTimeZone(c.getTimeZone());
        Date date = c.getTime();
        
        if(run == 0)
        {
        	info.setText("Ende des " + block + ". Blocks.");
        	int t = block+1;
        	logger.info("Anfang des " + t + ". Blocks  " + f.format(date));
        	logger.info("--------------------------------");
        }
        else
        	info.setText("Ende des " + run + ". Durchgangs.");
        
		weiter = (Button) findViewById(R.id.Button01);
        
        weiter.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {          
            	
                logger.info("weiter gedrueckt");
                
                finish();
            }

        });
	}


}

